import VueRouter from "vue-router";
import Vue from "vue";
// 引入二级组件
// import CodeLogin from '@/pages/center/codeLogin'
import CodeLogin from "@/pages/center/codeLogin";
import LoginSuccess from "@/pages/center/loginSuccess";
import PassLogin from "@/pages/center/passLogin";
import MyOrder from "@/pages/center/myOrder";
Vue.use(VueRouter);
let router = new VueRouter({
  routes: [
    {
      name: "home",
      path: "/home",
      component: () => import("@/pages/home"),
      meta: {
        show: true,
      },
    },
    {
      path: "/category",
      component: () => import("@/pages/category"),
      meta: {
        show: true,
      },
    },
    {
      path: "/search",
      component: () => import("../pages/category/search/index.vue"),
      meta: {
        show: false,
      },
    },
    // 分类
    {
      path: "/catelist",
      component: () => import("@/pages/category/catelist"),
      meta: {
        show: false,
      },
    },
    {
      path: "/innerSearch",
      component: () => import("../pages/category/innerSearch/index.vue"),
    },
    {
      path: "/searchOutList",
      component: () => import("../pages/category/searchOutList/index.vue"),
    },
    {
      path: "/worth",
      component: () => import("@/pages/worth"),
      meta: {
        show: true,
      },
    },
    {
      name: "shopcart",
      path: "/shopcart",
      component: () => import("@/pages/shopcart"),
      meta: {
        show: true,
      },
    },
    {
      path: "/order",
      component: () => import("@/pages/shopcart/order"),
      meta: {
        show: false,
      },
    },
    {
      path: "/center",
      meta: {
        show: false,
      },
      component: () => import("@/pages/center"),
    },

    {
      path: "/codelogin",
      component: CodeLogin,
      meta: {
        show: false,
      },
    },
    {
      path: "/loginsuccess",
      component: LoginSuccess,
      meta: {
        show: true,
      },
    },
    {
      path: "/myorder",
      component: MyOrder,
      meta: {
        show: false,
      },
    },
    {
      path: "/passlogin",
      component: PassLogin,
    },
    {
      path: "/",
      redirect: "/home",
    },
  ],
});
export default router;
